import '../item_style.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'sunburst_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SunburstEmphasis {
  var focus;
  var blurScope;
  SeriesLabel? label;
  LabelLine? labelLine;
  ItemStyle? itemStyle;

  SunburstEmphasis(
      {this.focus, this.blurScope, this.label, this.labelLine, this.itemStyle});

  factory SunburstEmphasis.fromJson(Map<String, dynamic> json) =>
      _$SunburstEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$SunburstEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SunburstBlurSelectEmphasis {
  SeriesLabel? label;
  LabelLine? labelLine;
  ItemStyle? itemStyle;

  SunburstBlurSelectEmphasis({this.label, this.labelLine, this.itemStyle});

  factory SunburstBlurSelectEmphasis.fromJson(Map<String, dynamic> json) =>
      _$SunburstBlurSelectEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$SunburstBlurSelectEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SunburstData {
  var value;
  var name;
  var link;
  var target;
  SeriesLabel? label;
  LabelLine? labelLine;
  ItemStyle? itemStyle;

  SunburstData(
      {this.value,
      this.name,
      this.link,
      this.target,
      this.label,
      this.labelLine,
      this.itemStyle});

  factory SunburstData.fromJson(Map<String, dynamic> json) =>
      _$SunburstDataFromJson(json);

  Map<String, dynamic> toJson() => _$SunburstDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SunburstLevel {
  SeriesLabel? label;
  LabelLine? labelLine;
  ItemStyle? itemStyle;
  SunburstEmphasis? emphasis;
  SunburstBlurSelectEmphasis? blur;
  SunburstBlurSelectEmphasis? select;

  SunburstLevel(
      {this.label,
      this.labelLine,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select});

  factory SunburstLevel.fromJson(Map<String, dynamic> json) =>
      _$SunburstLevelFromJson(json);

  Map<String, dynamic> toJson() => _$SunburstLevelToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SunburstSeries {
  var type = 'sunburst';
  var id;
  var name;
  var zlevel;
  var z;
  var center;
  var radius;
  List<SunburstData>? data;
  var labelLayout;
  LabelLine? labelLine;
  ItemStyle? itemStyle;

  var nodeClick;
  var sort;
  var renderLabelForZeroData;
  SunburstEmphasis? emphasis;
  SunburstBlurSelectEmphasis? blur;
  SunburstBlurSelectEmphasis? select;
  var selectedMode;

  List<SunburstLevel>? levels;

  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;

  SunburstSeries(
      {this.id,
      this.name,
      this.zlevel,
      this.z,
      this.center,
      this.radius,
      this.data,
      this.labelLayout,
      this.labelLine,
      this.itemStyle,
      this.nodeClick,
      this.sort,
      this.renderLabelForZeroData,
      this.emphasis,
      this.blur,
      this.select,
      this.selectedMode,
      this.levels,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate});

  factory SunburstSeries.fromJson(Map<String, dynamic> json) =>
      _$SunburstSeriesFromJson(json);

  Map<String, dynamic> toJson() => _$SunburstSeriesToJson(this);
}
